package com.ep.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ep.common.utils.PageUtils;
import com.ep.modules.app.dao.AppInspectionRecordMapper;
import com.ep.modules.app.entity.AppInspectionRecord;
import com.ep.modules.app.entity.AppInspectionRecordExample;
import com.ep.modules.app.service.AppInspectionRecordService;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AppInspectionRecordServiceImpl implements AppInspectionRecordService {
    @Autowired
    private AppInspectionRecordMapper appInspectionRecordMapper;

    public PageUtils queryPage(Map<String, Object> params) {
        String searchKey = (String)params.get("searchKey");
        Long searchUserId = (Long)params.get("searchUserId");
        AppInspectionRecordExample example = new AppInspectionRecordExample();
        AppInspectionRecordExample.Criteria criteria = example.createCriteria();
        List<AppInspectionRecord> list = appInspectionRecordMapper.selectByExample(example);
        Page<AppInspectionRecord> page = new Page<>();
        page.setRecords(list);
        return new PageUtils(page);
    }

    public AppInspectionRecord getById(Long id) {
        return appInspectionRecordMapper.selectByPrimaryKey(id.intValue());
    }

    public void save(AppInspectionRecord entity) {

        /////appInspectionRecordMapper.insert(entity);
    }

    public void update(AppInspectionRecord entity) {

        /////appInspectionRecordMapper.updateByPrimaryKeySelective(entity);
    }

    public void deleteBatch(Long[] ids) {
        for (Long id : ids) {
                appInspectionRecordMapper.deleteByPrimaryKey(id.intValue());
        }
    }
}